from csv import excel

try:    # 捕获异常
    open('filewrite1.txt','r')
    # print(name)
except (FileNotFoundError, NameError) as e:  # 指定类型异常，其他异常是捕获不到的。e异常对象
    print(e)
    print("继续执行")

# tyr:
# except:         捕获所有异常

# tyr:
# except Exception as e:         捕获所有异常

try:
    print(123)
except Exception as e:
    print(e)
else: #  没有出现异常 分支
    print('没有出现异常')

finally:
    print('都会执行')